<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
<script type="text/javascript">
	const scores=[1,2,3,4,5]
     //数组求和的函数
	function getSum(array=[]) {
		let sum=0
		array.forEach((item)=>{
			sum+=item
		})
		return sum
	}

    //接收函数的返回值
	const res=getSum(scores)
	console.log(res)
</script>
</body>
</html>